//
//  @ Project : Galaxy Star Trading System
//  @ File Name : MsgDispatch.h
//  @ Date : 2014/9/5
//  @ Author :
//
//


#if !defined(_CMSGDISPATCH_H_H)
#define _CMSGDISPATCH_H_H

namespace GSTrader
{
	namespace TradeStrategy
	{
		class TRADE_STRATEGY_API CMsgDispatch
		{
		public:
			CMsgDispatch(CFramework* pFramework, bool bQueueThread);
			virtual ~CMsgDispatch();

			virtual void OnNewMsg(CMsg* pMsg);

		private:
			void ProcessThread();
			void OnDispatch(CMsg* pMsg);

		private:
			CFramework*	m_pFramework;
			CMsgQueue*  m_pMsgQueue;
			
			thread* m_pThread;
			bool m_bQueueThread;
		};
		
	}
}

#endif // _CMSGDISPATCH_H_H